
#include "../GUI.h"
#include "Core/Memory/HeapObject.h"
#include "Core/GUI/Button/IButton.h"

#ifndef _GUI_BUTTON_WIN32_
#define _GUI_BUTTON_WIN32_

namespace GUI
{
	namespace Win32
	{
		class Button : public Core::GUI::IButton, public Core::Memory::HeapObject
		{
		public:
			Button(const std::string & _strLabel);
			Button(const std::string & _strLabel, int _iWidth, int _iHeight);
			virtual ~Button();
			void Create(HWND _hWindow, HINSTANCE _hInstance);
			GUI_WIN32 virtual Core::GUI::WidgetType GetType() const;
			GUI_WIN32 virtual int GetId() const;
			GUI_WIN32 virtual const std::string & GetLabel() const;
			GUI_WIN32 virtual int GetWidth() const;
			GUI_WIN32 virtual int GetHeight() const;
			GUI_WIN32 virtual int GetX() const;
			GUI_WIN32 virtual int GetY() const;
			GUI_WIN32 virtual void Resize(int _iWidth, int _iHeight);
			GUI_WIN32 virtual void Move(int _x, int _y);
			GUI_WIN32 virtual void Accept(Core::GUI::IVerticalLayout * _pVerticalLayout);
			GUI_WIN32 virtual void Accept(Core::GUI::IHorizontalLayout * _pHorizontalLayout);
			GUI_WIN32 virtual void OnClick(VoidFunctionVoid _function);
			GUI_WIN32 virtual void Click();

		private:
			HWND m_hButton;
			int m_iWidth;
			int m_iHeight;
			int m_iX;
			int m_iY;
			int m_iId;
			std::string m_strLabel;
			VoidFunctionVoid m_fctOnClick;

			friend class VerticalLayout;
			friend class HorizontalLayout;
		};
	}
}

#endif // _GUI_BUTTON_WIN32_